<!-- 齐套分析 -->
<div class="ion-page" main>
    <ion-header>
        <ion-toolbar color="primary">
            <ion-icon name="arrow-back" class="bar-btn" (click)="back()" slot="start"></ion-icon>
            <ion-title (click)="backToTop()">齐套分析</ion-title>
            <ion-icon name="qr-scanner" class="bar-btn" slot="end" (click)="scan()"></ion-icon>
        </ion-toolbar>

        <div style="width: 100%; height: 44px; background-color: #0B82F1;" *ngIf="!drawOpen">
            <!--        <ion-icon name="hourglass" (click)="onOpenChange($event)" class="filter"></ion-icon>-->
            <ion-img src="assets/img/filter/filter2.svg" class="filter2" (click)="openMenu()"></ion-img>
            <!-- 搜索框 - 新版 -->
            <SearchBar id="SearchBarStyle" style="background: #0B82F1;" placeholder="请搜索..." [(ngModel)]="searchValue"
                       (onSubmit)="search()" (onCancel)="cancel()">
            </SearchBar>
        </div>

    </ion-header>

    <!-- 第三版，朱老师设计 -->
    <ion-content *ngIf="viewList">
        <ion-card *ngFor="let item of viewList" [routerLink]="['add']"
                  [queryParams]="{id: item.id, planstartdate: item.planstartdate, qty: item.qty}"
                  style="margin: 5px 16px;">
            <ion-card-header>
                <ion-label
                        style="width: 60%; float: left; font-size: 17px; color: #082744;font-family: Arial,Verdana,Sans-serif">
                    <b>{{item.project ? item.project.name : '暂无'}}</b>
                </ion-label>
                <ion-label style="width: 40%; float: right; text-align: right;font-size: 12px;color: #98a4b3;">
                    <!--                    原来的（11月7号之前的）-->
                    <!--                    {{item.opnum}}{{item.opname}}-{{item.qty}}件-->
                    <!--                    最新的（11月7号修改的）-->
                    {{item.project ? item.project.name : '暂无'}}{{item.projectwbs ? item.projectwbs.name : '暂无'}}
                    -{{item.qty}}件
                </ion-label>
            </ion-card-header>
            <ion-card-content style="padding: 10px 20px;">
                <!--                原来的（11月7号之前）-->
                <!--                <ion-label>-->
                <!--                    <span style="width: 60%; float: left;font-size: 14px;color: #98a4b3;">{{item.orderno}}</span>-->
                <!--                    <span *ngIf="item.productionstate == '0'"-->
                <!--                          style="width: 40%; float: right; text-align: right;font-size: 14px;color: #F3B100;">待开工</span>-->
                <!--                    <span *ngIf="item.productionstate == '1'"-->
                <!--                          style="width: 40%; float: right; text-align: right;font-size: 14px; color: #15B165;">加工中</span>-->
                <!--                    <span *ngIf="item.productionstate == '2'"-->
                <!--                          style="width: 40%; float: right; text-align: right;font-size: 14px;color: #F3B100;">暂停</span>-->
                <!--                    <span *ngIf="item.productionstate == '3'"-->
                <!--                          style="width: 40%; float: right; text-align: right;font-size: 14px;color: #F3B100;">报工</span>-->
                <!--                    <span *ngIf="item.productionstate == '4'"-->
                <!--                          style="width: 40%; float: right; text-align: right;font-size: 14px;color: #F3B100;">完工</span>-->
                <!--                    <span *ngIf="item.productionstate == null"-->
                <!--                          style="width: 40%; float: right; text-align: right;font-size: 14px;color: #F3B100;">暂无</span>-->
                <!--                </ion-label>-->
                <!--                新改的（11月7号改的）-->
                <ion-label>
                    <span style="width: 60%; float: left;font-size: 14px;color: #98a4b3;">{{item.orderno}}</span>
                    <span *ngIf="item.issuedstate == '0' || item.issuedstate === 'undefined' || item.issuedstate == undefined"
                          style="width: 40%; float: right; text-align: right;font-size: 14px;color: #F3B100;">待发布</span>
                    <span *ngIf="item.issuedstate == '1'"
                          style="width: 40%; float: right; text-align: right;font-size: 14px; color: #15B165;">已发布</span>
                </ion-label>
                <ion-label style="font-size: 12px; color: #bbc2ca;">
                    {{item.materials ? item.materials.name : '暂无'}}&nbsp;/&nbsp;{{item.batch ? item.batch : '暂无'}}&nbsp;/&nbsp;{{item.planenddate | date:'yyyy-MM-dd' }}
                </ion-label>
            </ion-card-content>
        </ion-card>

        <ion-infinite-scroll (ionInfinite)="doInfinite($event)" threshold="0%">
            <ion-infinite-scroll-content loadingSpinner="{{loadingSpinner}}"
                                         loadingText="{{loadingMoreText}}"></ion-infinite-scroll-content>
        </ion-infinite-scroll>

    </ion-content>

    <!-- 页面没有加载出来时，显示骨架屏 -->
    <ion-content *ngIf="!viewList">
        <!--        <app-skeleton-screen [noData]="noData"></app-skeleton-screen>-->
        <app-loading [noData]="noData"></app-loading>
    </ion-content>
</div>


<!-- 筛选条件 -->
<ion-menu side="start" swipe-gesture="false" type="overlay" (ionDidClose)="filter()">
    <ion-header>
        <ion-toolbar translucent>
            <ion-title>筛选条件</ion-title>
        </ion-toolbar>
    </ion-header>
    <ion-content>
        <ion-list>
            <ion-item *ngFor="let entry of checkboxData; let i = index">
                <ion-label>{{entry.name}}</ion-label>
                <ion-checkbox slot="end" [(ngModel)]="entry.checked"></ion-checkbox>
            </ion-item>
        </ion-list>
    </ion-content>
</ion-menu>






